import axios from '@/utils/request.js'

export const getArticleById = id => axios({
  url: '/v1_0/articles/' + id
})

// 收藏文章
export const addCollect = target => axios({
  method: 'POST',
  url: 'v1_0/article/collections',
  data: {
    target
  }

})
// * 取消收藏文章
export const deleteCollect = target => axios({
  method: 'DELETE',
  url: `v1_0/article/collections/${target}`
})
// 点赞文章
export const addLike = target => axios({

  method: 'POST',
  url: '/v1_0/article/likings',
  data: {
    target: target
  }
})

// 取消点赞
export const deleteLike = target => axios({

  method: 'DELETE',
  url: `/v1_0/article/likings/${target}`
})

